package com.xiaoshuidi.cloud.module.member.mapper.coupon;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xiaoshuidi.cloud.module.member.controller.admin.coupon.vo.*;
import com.xiaoshuidi.cloud.module.member.pojo.coupon.CouponEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Alex
 * @version generator
 * @description 优惠券表Mapper层
 * @date 2023-03-14 15:06:11
 */
@Mapper
public interface CouponMapper extends BaseMapper<CouponEntity> {

    List<CouponDetailedVo> couponDetailed(IPage<CouponDetailedVo> page, @Param("form") CouponDetailedForm form);

    List<CouponSelectVo> couponSelect();

    List<CouponListVo> selectCouponPage(IPage<CouponListVo> page, @Param("form") CouponQueryForm form);

    List<CouponEntity> selectAvailableCouponsByStoreId(@Param("storeId") Long storeId, @Param("couponType") Integer couponType);

    void deduceStock(@Param("id") Long couponId, @Param("num") Long couponNum);

    void addStock(@Param("id") Long couponId, @Param("num") Long couponNum);

    List<CouponListExeclVO> exportCouponList(@Param("form") CouponQueryForm form);

    void addSendStock(@Param("id") Long couponId, @Param("num") Long couponNum);

    void deduceSendStock(@Param("id") Long id, @Param("num") Long couponNum);

    List<CouponEntity> validBookingSendCoupon(@Param("vo") BookingCouponSendVO vo);

    List<CouponEntity> validNewSignSendCoupon(@Param("month") Long month, @Param("vo") NewSignCouponSendVO newSignCouponSendVO);

    List<CouponEntity> validOldBringsNewSendCoupon(@Param("month") Long month, @Param("vo") OldBringNewCouponSendVO oldBringNewCouponSendVO);
}
